package javacore;

public class EnumDemo {

    enum Day {
        SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY, FRIDAY, SATURDAY
    }

    enum Days2 {
        SUNDAY(0, "SUNDAY"), MONDAY(1, "MONDAY"), TUESDAY(2, "TUESDAY"),
        WEDNESDAY(3, "WEDNESDAY"),THURSDAY(4, "THURSDAY"), FRIDAY(5, "FRIDAY"), SATURDAY(6, "SATURDAY");

        int index;
        String desc;
        Days2(int index, String desc) {
            this.index = index;
            this.desc = desc;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }



    public static void main(String[] args) {
        System.out.println(Day.MONDAY.name());
        System.out.println(Day.MONDAY.toString());
        System.out.println(Weeks.values());

        for (Day day: Day.values()) {
            System.out.println( day.ordinal() + day.name() + " "  + day.compareTo(Day.MONDAY));
        }

        for (Days2 day: Days2.values()) {
            System.out.println( day.ordinal() + day.name() + " "  + day.getIndex() + day.getDesc());
        }
    }
}

enum Weeks {
    SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY, FRIDAY, SATURDAY
}